const path = require('path')

const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin;

module.exports = {
  port: '8899', //端口号
  host: '127.0.0.1', // ip地址
  hot: true, //是否热加载,
  proxy: { //代理配置
    '/soso':{
      target: 'https://c.y.qq.com',
      changeOrigin: true
    },
    '/api': {
      target: 'http://localhost:3000',
      changeOrigin: true
    }
  },
  // publicPath: './',
  alias: { //别名
    '@': path.resolve(__dirname, 'src')
  },
  module: {
    rules: [
      { 
        test: /\.less$/, 
        use: ['style-loader', 'css-loader','less-loader']
      }
    ]
  },
  plugins: [
    new BundleAnalyzerPlugin({
      openAnalyzer: false
    })
  ]


}